const app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    playStep: 0, //创建步骤 0:还未参与抽奖,1:抽奖后
    luckyPlayShowModel: false,
    maskShowModel: false,
    luckyMaShowModel: false,
    shareModel: false,
    postersModel: false,
    luckyResultModal:false, //中奖结果弹窗
    allPeopleModal: false,  //全部参与者弹窗
    luckyResult:'fail',
    ma:123456789,
    luckyDetail:'luckyDetail',
     info:{
            minPrice:1,
            maxPrice:2
        },
    dataArr:[]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var ma = this.data.ma;
    // 将邀请码三个三个空开
    var ma = ma.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " ");

    //  if(this.data.luckyResult){
    //    this.setData({
    //      luckyResultModal:true,
    //      maskShowModel:true,
    //      ma:ma
    //    })
    //  }

    this.setData({
      dataArr: app.globalData.dataArr
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function (options) {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  },
  playShowModal: function () {
    this.setData({
      luckyPlayShowModel: true,
      maskShowModel: true
    })
  },
  hiddenModels: function () {
    this.setData({
      luckyPlayShowModel: false,
      maskShowModel: false,
      luckyMaShowModel: false,
      shareModel: false,
      postersModel: false,
      luckyResultModal:false,
      allPeopleModal:false,
      postersModel:false
    })
  },
  toSeeMa: function () {
    this.setData({
      luckyMaShowModel: true,
      maskShowModel: true
    })
  },
  share: function () {
    this.setData({
      shareModel: true,
      maskShowModel: true
    })
  },
  showAllPeopleModal:function(){
    this.setData({
      allPeopleModal:true,
      maskShowModel: true
    })
  },
  shareWxFriend: function () {
    console.log("shareWxFriend")
    this.onShareAppMessage();
  },
  posters: function () {
    var that = this;
    that.setData({
      postersModel: true,
      maskShowModel: true
    })
  },
  
  back:function(){
    wx.navigateBack();
  },
  
})